﻿using System.Collections.Generic;
using Engine;
using NK;

namespace Game
{
    public class AppleLeavesBlock : FCSixFaceBlock
    {
        public Random m_random = new Random();

        public const int Index = 946;

        public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List<BlockDropValue> dropValues, out bool showDebris)
        {
            if (m_random.Bool(0.15f))
            {
                dropValues.Add(new BlockDropValue
                {
                    Value = 23,
                    Count = 1
                });
                showDebris = true;
            }
            else
            {
                base.GetDropValues(subsystemTerrain, oldValue, newValue, toolLevel, dropValues, out showDebris);
            }
        }

        public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            generator.GenerateCubeVertices(this, value, x, y, z, m_color, geometry.GetGeometry(m_texture).AlphaTestSubsetsByFace);
        }

        public AppleLeavesBlock()
            : base("Textures/FCBlocks/appleleave", Color.White)
        {
        }
    }
}